package cn.edu.anan.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 提供者controller
 * </p>
 *
 * @author yanghouhua@edu.com.cn
 * @since 2021/8/11
 */
@RestController
@RequestMapping("provider")
@Slf4j
public class ProviderController {

    @Value("${server.port}")
    private String serverPort;

    @Value("${spring.cloud.nacos.discovery.cluster-name}")
    private String clusterName;

    @RequestMapping("test")
    public String test(){
       log.info("当前服务实例接收到请求，端口：{}", serverPort);
        return "ProviderController---test.ok.port=" + serverPort + ".所在机房：" + clusterName;
    }
}
